﻿<Application 
    x:Class="IWantIn.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:local="clr-namespace:IWantIn">

    <!--Application Resources-->
    <Application.Resources>
        <!-- New styles and updated styles that enable a better match to what apps are supposed to look like: -->

        <Style x:Key="PhoneTextTitle0Style" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
            <Setter Property="Margin" Value="-1,0,0,0"/>
        </Style>

        <Style x:Key="PhoneTextTitle1Style" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeExtraExtraLarge}"/>
            <Setter Property="Margin" Value="-3,-10,0,0"/>
        </Style>

        <Style x:Key="PhoneTitlePanelStyle" TargetType="Panel">
            <Setter Property="Margin" Value="24,16,0,12"/>
        </Style>

        <Style x:Key="PhoneTextGroupHeaderStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
        </Style>

        <!-- A style for text blocks that act as a label for a text box -->
        <Style x:Key="LabelStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
            <Setter Property="Margin" Value="12,17,12,-5"/>
        </Style>

        <!-- A button style that removes the border, padding, state changes for 
            pressing/disabling, and ignores various properties like Foreground.
            It simply displays its content with no frills 
            other than the tilt effect. -->
        <Style x:Key="SimpleButtonStyle" TargetType="Button">
            <Setter Property="local:Tilt.IsEnabled" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <ContentControl x:Name="ContentContainer"
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
                                        Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>